/**
This is the Thrift definition for the Library component

Each log listener subscribes to receive log levels at a certain level, where 100 is the highest and 0 is the lowest

Other recommended levels:
	90 - Critical Error
	80 - Error
	70 - Warning
	50 - Mild mishap
	30 - Informative information
	20 - Verbose information
	10 - Debug information
*/
namespace java hydrap2p.logging
namespace csharp hydrap2p.logging

include "service.thrift"

/** 
Uniquely identifies a object
*/
typedef i64 UID

enum Level {
	FATAL = 6,
	ERROR = 5,
	MISHAP = 4,
	INFO = 3,
	DEBUG = 2,
	VERBOSE = 1,
}

/**
A LoggingListener is an object that receives log events and processes them in some manner
*/
service LoggingListener extends service.Service {
	/**
		Logs the given entry to the listener
	*/
	void log(1:Level severity, 2:string logEntrySource, 3:string logMessage),
}

/**
The main Logging interface
*/
service Logging extends service.Service {

	/**
		Forwards a certain log entry to any listening LogListeners
	*/
	void log(1:Level severity, 2:string logEntrySource, 3:string logMessage),
	
	/**
		Subscribes this given listener to subscribe all log events that have a severity that is greater than or equal to the given severity
		If the given listener is already listening, its subscription will be changed to the new severity level
	*/
	void subscribe(1:service.ServiceLocation location, 2:Level minimumSeverity),
	
	/**
		Unsubscribes the given listener from recieving log events
	*/
	void unsubscribe(1:service.ServiceLocation location),
}
